﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Members.aspx.cs" Inherits="BookNet.Admin.Members" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:booknetConnectionString1 %>" 
            DeleteCommand="DELETE FROM app_UserProfile WHERE (UserID = @UserID)" 
            SelectCommand="SELECT aspnet_Membership.Email, aspnet_Membership.PasswordQuestion, aspnet_Membership.PasswordAnswer, aspnet_Membership.IsApproved, aspnet_Membership.CreateDate, aspnet_Membership.LastLoginDate, aspnet_Membership.LastPasswordChangedDate, aspnet_Membership.FailedPasswordAttemptCount, aspnet_Users.UserName, app_UserProfile.FullName, app_UserProfile.Gender, app_UserProfile.DateofBirth, app_UserProfile.Faculty, app_UserProfile.Bio, app_UserProfile.Phone FROM aspnet_Membership INNER JOIN aspnet_Users ON aspnet_Membership.UserId = aspnet_Users.UserId INNER JOIN app_UserProfile ON aspnet_Membership.UserId = app_UserProfile.UserID" 
            
            UpdateCommand="UPDATE app_UserProfile SET FullName =@FullName, Gender =@Gender , DateofBirth =@DateofBirth , Faculty =@Faculty , Bio =@Bio , Phone =@Phone  FROM app_UserProfile INNER JOIN aspnet_Membership ON app_UserProfile.UserID = aspnet_Membership.UserId INNER JOIN aspnet_Users ON app_UserProfile.UserID = aspnet_Users.UserId">
            <DeleteParameters>
                <asp:Parameter Name="UserID" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="UserID" />
                <asp:Parameter Name="FullName" />
                <asp:Parameter Name="Gender" />
                <asp:Parameter Name="DateofBirth" />
                <asp:Parameter Name="Faculty" />
                <asp:Parameter Name="Bio" />
                <asp:Parameter Name="Phone" />
            </UpdateParameters>
        </asp:SqlDataSource>
    
    </div>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
        AllowSorting="True" PageSize="20">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="PasswordQuestion" HeaderText="PasswordQuestion" 
                SortExpression="PasswordQuestion" />
            <asp:BoundField DataField="PasswordAnswer" HeaderText="PasswordAnswer" 
                SortExpression="PasswordAnswer" />
            <asp:CheckBoxField DataField="IsApproved" HeaderText="IsApproved" 
                SortExpression="IsApproved" />
            <asp:BoundField DataField="CreateDate" HeaderText="CreateDate" 
                SortExpression="CreateDate" />
            <asp:BoundField DataField="LastLoginDate" HeaderText="LastLoginDate" 
                SortExpression="LastLoginDate" />
            <asp:BoundField DataField="LastPasswordChangedDate" 
                HeaderText="LastPasswordChangedDate" SortExpression="LastPasswordChangedDate" />
            <asp:BoundField DataField="FailedPasswordAttemptCount" 
                HeaderText="FailedPasswordAttemptCount" 
                SortExpression="FailedPasswordAttemptCount" />
            <asp:BoundField DataField="UserName" HeaderText="UserName" 
                SortExpression="UserName" />
            <asp:BoundField DataField="FullName" HeaderText="FullName" 
                SortExpression="FullName" />
            <asp:BoundField DataField="Gender" HeaderText="Gender" 
                SortExpression="Gender" />
            <asp:BoundField DataField="DateofBirth" HeaderText="DateofBirth" 
                SortExpression="DateofBirth" />
            <asp:BoundField DataField="Faculty" HeaderText="Faculty" 
                SortExpression="Faculty" />
            <asp:BoundField DataField="Bio" HeaderText="Bio" SortExpression="Bio" />
            <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
        </Columns>
    </asp:GridView>
    </form>
</body>
</html>
